package shiqi.PrototypePattern.shallowClone;

public class Test {

    public static void main(String[] args) {
        Email email, copyEmail;

        email = new Email();
        copyEmail = (Email)email.clone();

        //复制新的对象，所以返回false
        System.out.println(email == copyEmail);
        //不复制成员变量所引用的对象，所以复制的对象的成员变量依旧指向原来所引用的对象，返回true
        System.out.println(email.getAttachement() == copyEmail.getAttachement());
    }
}
